using MidnightPeach.Engine.Packages;
using MidnightPeach.Engine.Schema;
using MidnightPeach.Engine.Schema.ServiceSchema;

namespace MidnightPeach.Engine.Generators.ServiceGenerators
{
    class ClassGenerator : ServiceGenerator
    {
        public ClassGenerator(Package package, Class @class) : base(package)
        {
            Class = @class;
        }

        public Class Class { get; private set; }

        internal override string Generate(Macro macro, string text)
        {
            switch (macro.Value)
            {
                case "PascalName":
                    return Class.PascalName;

                case "CamelName":
                    return Class.CamelName;

                default:
                    throw new UnsupportedMacroException(macro, text, this);
            }
        }
    }
}